package com.ruoyi.service.towComp.impl;


import com.ruoyi.mapper.towComp.MechanicsMapper;
import com.ruoyi.service.towComp.MechanicsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class MechanicsServiceImpl implements MechanicsService {

    @Autowired
    MechanicsMapper mechanicsMapper;

    @Override
    public List<Map<String, Object>> findMechanics(Map map) {
        return mechanicsMapper.findMechanics(map);
    }

    @Override
    public int add(Map map) {
        return mechanicsMapper.add(map);
    }

    @Override
    public Map findMechanicsById(String id) {
        return mechanicsMapper.findMechanicsById(id);
    }


    @Override
    public int edit(Map map) {
        return mechanicsMapper.edit(map);
    }

    @Override
    public int remove(String ids) {
        String[] idSplit = ids.split(",");
        int num = 0;
        for (String id : idSplit) {
            num += mechanicsMapper.removeData(id);
        }
        return num;
    }
}
